﻿@model BBICMS.Application.InputModels.Accounts.ProfileIM
@{
    ViewBag.Title = Title.Profile;
}


@section header{
<link href="~/Content/iconfont/font-awesome/css/font-awesome.min.css" rel="stylesheet" />
    <link href="~/plugins/toastr/toastr.min.css" rel="stylesheet" />
}


@section featured{
    <div class="sitepath">
        <div class="container">
            <div class="row">
                @*<div class="col-xs-4">
                    <h1>@ViewBag.Title</h1>
                </div>*@
                <div class="col-xs-8">
                    <ol class="breadcrumb">
                        <li><a href="/">@Menu.Home</a></li>
                        <li class="active">@ViewBag.Title</li>
                    </ol>
                </div>
            </div>
        </div>
    </div>
}


<div class="container page-member">
    <div>

        <!-- Nav tabs -->
        <ul class="nav nav-tabs" role="tablist">
            <li role="presentation" class="active"><a href="#home" aria-controls="home" role="tab" data-toggle="tab"><i class="iconfont icon-profile fa-fw"></i>@Title.Profile</a></li>
            <li role="presentation"><a href="@Url.Action("MyFavorites")" aria-controls="profile" role="tab" data-toggle="tab"><i class="iconfont icon-shoucangjia fa-fw"></i>@Title.MyFavorites</a></li>
            <li role="presentation"><a href="@Url.Action("UpdatePWD")" aria-controls="messages" role="tab" data-toggle="tab"><i class="iconfont icon-mima fa-fw"></i>@Title.Security</a></li>         
        </ul>

        <!-- Tab panes -->
        <div class="tab-content">
            <div role="tabpanel" class="tab-pane active " id="home">
                <div class="row p-t-100 p-b-50">
                    <div class="col-xs-6 col-xs-offset-3">
                    @using (Ajax.BeginForm("UpdateProfile", null, new AjaxOptions
                    {

                        HttpMethod = "POST",
                        OnBegin = "onBegin",
                        OnComplete = "onComplete",
                        OnSuccess = "updateSuccess"

                    }, new { role = "form",@class= "form-horizontal" }))
                    {
                            @Html.AntiForgeryToken()
                            @Html.ValidationSummary(false)


                            <div class="form-group">
                                @Html.LabelFor(u => u.DisplayName,new { @class= "col-xs-3 control-label" })
                                <div class="col-xs-9">
                                    @Html.TextBoxFor(m => m.DisplayName, new { @class = "form-control", placeholder = Labels.DisplayName })
                                </div>
                            </div>

                            <div class="form-group">
                                @Html.LabelFor(u => u.Company, new { @class = "col-xs-3 control-label" })
                                <div class="col-xs-9">
                                    @Html.TextBoxFor(m => m.Company, new { @class = "form-control", placeholder = Labels.Company })
                                </div>
                            </div>

                            <div class="form-group">
                                @Html.LabelFor(u => u.Phone, new { @class = "col-xs-3 control-label" })
                                <div class="col-xs-9">
                                    @Html.TextBoxFor(m => m.Phone, new { @class = "form-control", placeholder = Labels.Phone })
                                </div>
                            </div>
                            <div class="form-group">
                                <div class="col-xs-9 col-xs-offset-3">
                                    <button type="submit" class="btn btn-primary" id="btnSave"><i class="fa fa-save fa-fw"></i>  @Buttons.Save </button>
                                </div>
                            </div>
                    }
                    </div>
                </div>
            </div>
            <div role="tabpanel" class="tab-pane" id="profile">...</div>
            <div role="tabpanel" class="tab-pane" id="messages">...</div>
            <div role="tabpanel" class="tab-pane" id="settings">...</div>
        </div>

    </div>

</div>


@section scripts {
    @Scripts.Render("~/bundles/jqueryvalWithBootstrap")
    <script src="~/plugins/toastr/toastr.min.js"></script>
    <!-- pre load bg imgs -->
    <script type="text/javascript">
            function onBegin() {
                $("#btnSave i").removeClass("fa-save").addClass("fa-spinner fa-spin")
            }
            function onComplete() {
                $("#btnSave i").removeClass("fa-spinner fa-spin").addClass("fa-save")
            }
            function updateSuccess(data) {
                var title = '@ViewBag.Title';
                Common.ShowBox(data.Status, data.Message, title);
            }
           
    </script>
}
